home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / hidden < prev    next >
Internet Message Format  |  1995-03-31  |  5KB

  1. From comp.sys.handhelds Tue Jun 11 18:30:13 1991
  2. Path: seq!ecsgate!mcnc!taco!gatech!ncar!elroy.jpl.nasa.gov!swrinde!mips!spool.mu.edu!news.cs.indiana.edu!noose.ecn.purdue.edu!en.ecn.purdue.edu!blair
  3. From: blair@en.ecn.purdue.edu (Marc E Blair)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: hidden variable utility for HP48
  6. Summary: a way to easily deal with hidden variables
  7. Keywords: hidden variable
  8. Message-ID: <1991Jun11.053031.12123@en.ecn.purdue.edu>
  9. Date: 11 Jun 91 05:30:31 GMT
  10. Organization: Purdue University Engineering Computer Network
  11. Lines: 227
  12.  
  13. Hello everyone! This program is designed so users
  14. can enjoy the added feature of hidden variables without 
  15. accidently causing "Try to recover memory?" errors. Here is a description of
  16. what each program does:
  17.  
  18. NORMAL - restores a directory to its natural state, i.e. no
  19.          hidden variables
  20.  
  21. HIDE   - takes an argument from level one, a variable name or list,
  22.          and hides it. 
  23.  
  24. ALL    - returns a list of all variables, including the '' variable and
  25.          others hidden behind it.
  26.  
  27. HIDEN  - returns a list of only hidden variables.
  28.  
  29. NULL   - creates '' on the stack 
  30.  
  31. SPACE  - creates ' ' on the stack (I use it to create directories with no
  32.          name - I set up my home menu to have only a no-name directory,
  33.          and then use my no-name directory as my home diectory. This way
  34.          I can hide "personalized commands" and other variables (like PRTPAR) 
  35.          since no variables may be hidden in the home directory
  36.          (due to system use))
  37.  
  38. DELIT  - takes a list from level 2 and an object from level one and deletes
  39.          that object in the list if it exists. Used by HIDE program 
  40.  
  41. KEYS   - redefines user keys for PURGE and CLVAR so one does not accidently
  42.          delete a non-empty directory that looks empty.
  43.  
  44. DISCLAIMER: I am not repsonsible for memory problems that may result
  45. from cosmic rays while you are using this program or anything else.
  46.  
  47. enjoy!
  48. ----------------------------------------------------------->8
  49. %%HP: T(3)A(D)F(.);
  50. DIR
  51.   NORMAL
  52.     \<<
  53.       IF PATH {
  54. HOME } \=/
  55.       THEN NULL
  56. PURGE
  57.       END
  58.     \>>
  59.   HIDE
  60.     \<<
  61.       IF DUP TYPE 6
  62. ==
  63.       THEN 1 \->LIST
  64.       END \-> L
  65.       \<< VARS L SIZE
  66. 1 SWAP
  67.         FOR A L A
  68. GET DELIT
  69.         NEXT
  70.         IF PATH {
  71. HOME } \=/
  72.         THEN 5 NULL
  73. STO NULL 1 \->LIST +
  74. ORDER
  75.         ELSE DROP
  76. "NOT ALLOWED AT HOME"
  77. DOERR
  78.         END
  79.       \>>
  80.     \>>
  81.   ALL
  82.     \<< VARS DUP SIZE
  83. NULL RCL \-> S A
  84.       \<< NULL
  85.         IFERR PURGE
  86.         THEN DROP
  87.         ELSE A NULL
  88. RCL
  89.           IF SAME
  90. NOT
  91.           THEN VARS
  92. A NULL STO SWAP
  93.             IFERR
  94. ORDER
  95.             THEN
  96. DROP
  97.             END DUP
  98. 1 S SUB SWAP DUP
  99. SIZE S 1 + SWAP SUB
  100. NULL SWAP + +
  101.           END
  102.         END
  103.       \>>
  104.     \>>
  105.   HIDEN
  106.     \<< ALL DUP DUP
  107. NULL POS
  108.       IF DUP 0 \=/
  109.       THEN 1 + SWAP
  110. SIZE SUB
  111.         IFERR NULL
  112. RCL DROP
  113.         THEN DROP {
  114. }
  115.         ELSE
  116.           IF PATH {
  117. HOME } \=/
  118.           THEN NULL
  119. SWAP +
  120.           ELSE DROP
  121. { }
  122.           END
  123.         END
  124.       ELSE 3 DROPN
  125. { }
  126.       END
  127.     \>>
  128.   NULL
  129.     \<< "" # 5B15h
  130. SYSEVAL
  131.     \>>
  132.   SPACE
  133.     \<< " " # 5B15h
  134. SYSEVAL
  135.     \>>
  136.   DELIT
  137.     \<< OVER SIZE \-> S
  138.       \<< DUP2 POS \->
  139. A
  140.         \<<
  141.           IF A 0 \=/
  142.           THEN
  143.             IF S 1
  144. ==
  145.             THEN
  146. DROP2 { }
  147.             ELSE
  148.               IF A
  149. 1 ==
  150.               THEN
  151. SWAP 2 S SUB SWAP
  152. DROP
  153.               ELSE
  154. IF A S ==
  155. THEN SWAP 1 S 1 -
  156. SUB SWAP DROP
  157. ELSE SWAP DUP 1 A 1
  158. - SUB SWAP A 1 + S
  159. SUB + SWAP DROP
  160. END
  161.               END
  162.             END
  163.           ELSE DROP
  164.           END
  165.         \>>
  166.       \>>
  167.     \>>
  168.   KEYSTO
  169.     \<< { S
  170.       \<<
  171.         IFERR { }
  172. SWAP DUP
  173.           IF TYPE 5
  174. ==
  175.           THEN DUP
  176. SIZE
  177.           ELSE 1
  178. \->LIST 1
  179.           END 1
  180. SWAP
  181.           FOR A DUP
  182. A GET RCL
  183.             IF TYPE
  184. 15 ==
  185.             THEN
  186.               IF
  187. DUP A GET RCL BYTES
  188. SWAP DROP 6.5 ==
  189.               THEN
  190. 1
  191.               ELSE
  192. 0
  193.               END
  194.             ELSE 1
  195.             END
  196.             IF
  197.             THEN
  198. DUP A GET PURGE
  199.             ELSE
  200. DUP A GET ROT SWAP
  201. + SWAP
  202.             END
  203.           NEXT DROP
  204.           IF DUP {
  205. } \=/
  206.           THEN \->STR
  207. "
  208. Non-empty directory"
  209. + DOERR
  210.           ELSE DROP
  211.           END
  212.         THEN
  213.           IF { } ==
  214.           THEN
  215. "Too Few Arguements"
  216.           ELSE
  217. DROP2
  218. "Not Purgable"
  219.           END DOERR
  220.         END
  221.       \>> 54.2
  222.       \<<
  223.         IF PATH {
  224. HOME } \=/
  225.         THEN ""
  226. # 5B15h SYSEVAL
  227. PURGE
  228.         END VARS
  229. "HIT PURGE" 1 DISP
  230. 1 FREEZE
  231.       \>> 54.3 }
  232. STOKEYS
  233.     \>>
  234. END
  235. --------------8<----------
  236.  
  237. Marc Blair
  238.  
  239. blair@en.ecn.purdue.edu         "The HP48: But, can it cook?"
  240.  
  241.